﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//New and needed
using IM.Domain.TransManager;

namespace IM.Domain.AppServices
{
    public class ServiceLocator:IServiceLocator
    {
        static readonly Object LocatorLock = new object();

        private static ServiceLocator InternalInstance;

        private ServiceLocator() { }

        public static ServiceLocator Instance()
        {
            if (InternalInstance == null)
            {
                lock (LocatorLock)
                {
                    if (InternalInstance == null)
                    {
                        InternalInstance = new ServiceLocator();
                    }
                }
            }

            return InternalInstance;
        }

        #region IServiceLocator Members

        public ITransFactory TransFactory
        {
            get;
            set;
        }

        public IBusinessNotifier Notifier
        {
            get;
            set;
        }

        #endregion
    }
}
